﻿namespace FlexPlatform.BusinessLogic
{
    using System.Collections.Generic;

    using FlexPlatform.Shared;
    using FlexPlatform.Shared.Validation;
    using System;

    public interface IValidator
    {
        /// <summary>
        /// Validates a proposed value.
        /// The validator tries to check all the rules that are attached to the target property.
        /// If one of the rules do not pass, the validation process is stopped.
        /// </summary>
        /// <param name="proposedValue">The value to be checked.</param>
        /// <returns>The list of validation results.</returns>
        IEnumerable<IValidationResult> Validate(object proposedValue);
    }
}
